package com.smart.community.region.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * 模板验证结果VO
 * 
 * @author Wu.Liang
 * @since 2025-01-30
 */
@Data
@Schema(description = "模板验证结果VO")
public class TemplateValidationResult {

    @Schema(description = "是否验证通过")
    private Boolean isValid;

    @Schema(description = "楼栋数据统计")
    private DataStatistics buildingStats;

    @Schema(description = "单元数据统计")
    private DataStatistics unitStats;

    @Schema(description = "房户数据统计")
    private DataStatistics householdStats;

    @Schema(description = "验证错误列表")
    private List<ValidationError> errors;

    @Schema(description = "数据预览")
    private Map<String, Object> dataPreview;

    /**
     * 数据统计
     */
    @Data
    @Schema(description = "数据统计")
    public static class DataStatistics {
        @Schema(description = "总数量")
        private Integer totalCount;

        @Schema(description = "有效数量")
        private Integer validCount;

        @Schema(description = "错误数量")
        private Integer errorCount;

        @Schema(description = "重复数量")
        private Integer duplicateCount;
    }

    /**
     * 验证错误
     */
    @Data
    @Schema(description = "验证错误")
    public static class ValidationError {
        @Schema(description = "工作表名称")
        private String sheetName;

        @Schema(description = "行号")
        private Integer rowNumber;

        @Schema(description = "列名")
        private String columnName;

        @Schema(description = "错误类型")
        private String errorType;

        @Schema(description = "错误描述")
        private String errorMessage;

        @Schema(description = "错误建议")
        private String suggestion;
    }
}
